const Koa = require('koa')


// 实例化应用
const app = new Koa()

app.keys = ['signKey'] // 推荐使用随机字符串，必须写
// 中间件
app.use(async (ctx) => {
    ctx.cookies.set('logged', 2, {
        signed: true,
        httpOnly: true,
        maxAge: 3600 * 24 * 1000
    })
    ctx.body = 'ok'
})

app.listen(8899, () => {
    console.log('listen on 8899');
})